package testing.dao;

import static org.junit.Assert.*;

import java.util.ArrayList;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import service.IUserinfoService;
import service.impl.IUserinfoServiceImpl;
import dao.IUserinfoDAO;
import entity.Storage;
import entity.Userinfo;
import dao.*;
public class TestStorageDAOImpl {
	ApplicationContext context = null;
	IStorageDAO dao = null;
	@Before
	public void setUp() throws Exception {
		context = new FileSystemXmlApplicationContext("classpath*:spring-config-*.xml"); 
		dao = (IStorageDAO) context.getBean("storageDAO");
	}

	@After
	public void tearDown() throws Exception {
		context = null;
	}

	@Test
	public void testFindUserinfoByProperties() {
		
//		Storage user = new Storage();
//		user.setUsername("admin");
//		user.setUserpwd("admin");
		ArrayList<Storage> storage = null ;
		try {
			storage = dao.findAllStorage();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		
		
		
		
	}
}
